package org.catj.entity;

public class Attribute {
    private AttributeScale scale;
    private String name;
    private int value;

    public Attribute(String name, int value, AttributeScale scale) {
        setName(name);
        setValue(value);
        setScale(scale);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public AttributeScale getScale() {
        return scale;
    }

    public void setScale(AttributeScale scale) {
        this.scale = scale;
    }

    public double getRank() {
        return getScale().getRank(getValue());
    }

    public String toString() {
        return getScale().toString() + " " + getName() + " : " + getValue() + " : " + getRank();
    }
}
